package com.victualler.core.base.service;

import com.victualler.core.base.dao.BaseDetailDao;
import com.victualler.core.base.repository.BaseDetailRepository;
import com.victualler.core.base.repository.IBaseQueryRepository;

import java.util.List;

/**
 * @Author: Guoshichang
 * @Date: Create in 18:00 2018/4/5
 * @Discription: 为子表提供单独的服务 继承自父的基础服务类
 */
public interface BaseDetailService<E extends BaseDetailDao,R extends BaseDetailRepository<E,Long>,QR extends IBaseQueryRepository<E,Long>> extends BaseService<E,R,QR>{

    /**
     * 根据父id获取对应的子表id
     * @param parentId
     * @return
     */
    public List<E> getByParentId(Long parentId);

    /**
     * 根据父id删除子表的记录
     * @param parentId
     */
    public void deleteByParentId(Long parentId);

    /**
     * @Aouthor Guoshichang
     * @Date 16:49 on 2018/6/15.
     * @param newDaoList
     * @param parentId
     * @Function 根据新的列表增减其他列表
     */
    public void updateList(List<E>  newDaoList,Long parentId);

}
